<?php
class ControllerModuleKeyword extends Controller {
	protected function index($setting) {
		$this->language->load('module/keyword');
 
      	$this->data['heading_title'] = $this->language->get('heading_title');
				
		$this->data['button_cart'] = $this->language->get('button_cart');
		
		$this->load->model('promotion/keyword');
		
		$this->data['keywords'] = array();

		$results = $this->model_promotion_keyword->getKeywordsForHome($setting['limit']);
		
		foreach ($results as $result) {							
			$this->data['keywords'][] = array(
				'id'          => $result['id'],
				'keyword'     => $result['keyword'],
				'href'    	  => $this->url->linkRewrite(ROUTE_SEARCH_R, $result['keyword']),
			);
		}

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/keyword.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/module/keyword.tpl';
		} else {
			$this->template = 'default/template/module/keyword.tpl';
		}

		$this->render();
	}
}
?>